#pragma once

#include "stdafx.h"
#include <tiffio.h>
#include <jpeglib.h>
#include <libexif/exif-data.h>
#include <string>
#include <atlpath.h>
#include <list>

using namespace std;

class TIFFSplitter
{
public:
	TIFFSplitter(void);
	virtual ~TIFFSplitter(void);

	static bool splitTIFF(const CString& filePath);
	static bool splitTIFFWithinDirectory(const CString& dirPath);

	

	static CString getFilePathWithoutName(const CString& filePath);	

	static bool extractTIFF(const CPath &dir, const CString &fileName, TIFF *input);

	static bool extractNonColorImage(const CString &dir, TIFF *input);
	static bool extractColorImage(const CString &dir, TIFF *input);

	static void updateSplittedFileNamesListBox(const CString &name);

private:
	static list<CString> tobeSplitted;

	static void collectToBeSplittedFiles(const CString &dirPath);

	static void recursiveCollectToBeSplittedFiles(const CString& dirPath);

	static void deleteOriginFiles(const CString &filePath);

	static bool isTiffFiles(const CString &fileName);
	// Deprecated, not suits to requirement
	static bool splitTIFF(const CString &fileSpecPath, const CString &filePath, int &splittedCount);
	// Deprecated, not suits to requirement
	static bool extractTIFF(const CPath &fileSpecPath, TIFF *input, int &splittedCount);

};

